/*
 * Copyright (c) 2017. Visionet and/or its affiliates. All right reserved.
 * VISIONET PROPRIETARY/CONFIDENTIAL.
 */
package com.visionet.jumper.core.support.spring;

import org.springframework.context.MessageSource;

/**
 * @author TC.Ubuntu
 * @since 2017/7/3.
 */
public class SpringMessageUtils {
	private static MessageSource messageSource;

	/**
	 * 获取异常错误信息国际化消息
	 * @param code
	 * @return 国际化消息
	 */
	public static String message(String code) {
		if (messageSource == null) {
			messageSource = SpringLocator.getBean("messageSource");
		}
		return messageSource.getMessage(code, null, null);
	}
}
